const OrdersPayController = require("../controllers/orderpayControllers");
const express = require("express");
const router = express.Router();
const authMiddleware = require("../middleware/authMiddleware");

// 添加新订单
router.post("/add", authMiddleware, OrdersPayController.addNewOrder);
// 根据 ID 删除订单
router.delete("/del/:id", authMiddleware, OrdersPayController.deleteOrderById);
// 根据 user_id 查询订单
router.get(
  "/user/:userId",
  authMiddleware,
  OrdersPayController.getOrdersByUserId
);
// 查询所有订单
router.get("/getAll", authMiddleware, OrdersPayController.getAllOrders);
router.get("/getSome/id/:userId", OrdersPayController.getLatestOrders);
module.exports = router;
